import { _decorator, Component, Node, Script, resources, SpriteFrame, Sprite, SpriteAtlas, director } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('test2')
export class test2 extends Component {

	@property({ type: Script, displayName:'' })
	private test2: Script = null;
    start() {
		// resources.load('test/land/spriteFrame',SpriteFrame, (err,data)=> {
		// 	console.debug(data,'data')
		// 	this.node.getComponent(Sprite).spriteFrame = data
		// })
		// resources.loadDir('test/11111', SpriteFrame,null, (err, data) => {
		// 		console.debug(data)
		// 	this.node.getComponent(Sprite).spriteFrame = data[0]
		// })

		// 跳转场景
		// director.loadScene('scene-002',()=>{ })

		// 加载到内存了，但还没用
		director.preloadScene('scene-002', () => { 
			director.loadScene('scene-002')
		})
		// 常驻结点

		// director.addPersistRootNode(this.node)
		// director.removePersistRootNode(this.node)
		
    }
    update(deltaTime: number) {
        
    }
}

